<?php

namespace app\admin\model;

use think\Model;
use think\model\concern\SoftDelete;
use app\admin\model\PermissionRole;

class Role extends Model
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $autoWriteTimestamp = 'datetime';

    const PAGESIZE = 15;

    public static function permission($roleId){
        $data = PermissionRole::where('role_id',$roleId)->value('permission_id');
        return $data ? explode(',',$data) : [];
    }
}
